﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="imageMaintenanceComments.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.imageMaintenanceComments" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">

        .style3
        {
            font-size: x-large;
        }
        .style4
        {
            color: #3399FF;
        }
        .pCommentB
        {
            width: 372px;
            height: 272px;
        }
        .maintenanceTags
        {
            width: 435px;
            height: 431px;
        }
        .MaintenanceList
    {
        height: 525px;
    }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <span class="st"><span class="style3"><strong>BMW - X6 </strong>
        <span class="style4"><em><strong>Maintenance</strong></em></span><strong> Image 
        Comments</strong></span></span></p>

        <div class = "imageMaintenance">
        
        
        
            So, you like your BMW - X6&#39;s then why not comment on this picture? It doesnt 
            cost you anything...<br />
                Click <a href = "Account/Register.aspx">here</a> to register or registered users can simply just <a href = "Account/Login.aspx">login</a>.<br />
        
        </div>
        <br />
        <div class = "imageMaintenanceContent">
        
        <div class = "pCommentC">
    
    
        <br />
        <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource4" 
            Height="204px" Width="494px" BorderStyle="Solid" Font-Size="Large" 
            CssClass="pCommentC" >
            <EditItemTemplate>
                <strong>Description:</strong>
                <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                <asp:TextBox ID="UserNameTextBox" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />

                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                <strong>Description:</strong>
                <asp:TextBox ID="ImageDescriptionTextBox0" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:TextBox ID="DateUploadedTextBox0" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:TextBox ID="TimeUploadedTextBox0" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <strong>Uploaded by:</strong>
                <asp:TextBox ID="UserNameTextBox0" runat="server" 
                    Text='<%# Bind("UserName") %>' />
                <br />

                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                <strong> Description:</strong>
                <asp:Label ID="ImageDescriptionLabel" runat="server" 
                    Text='<%# Bind("ImageDescription") %>' />
                <br />
                <br />
                <strong>Date Uploaded:</strong>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <br />
                <strong>Time Uploaded:</strong>
                <asp:Label ID="TimeUploadedLabel" runat="server" 
                    Text='<%# Bind("TimeUploaded") %>' />
                <br />
                <br />
                <strong>Uploaded by:</strong>
                <asp:Label ID="UserNameLabel" runat="server" Text='<%# Bind("UserName") %>' />
                <br />


            </ItemTemplate>
        </asp:FormView>
            <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                SelectCommand="SELECT Maintenance_Images.ImageDescription, Maintenance_Images.DateUploaded, Maintenance_Images.TimeUploaded, aspnet_Users.UserName, Maintenance_Images.MaintenanceImageID FROM (Maintenance_Images INNER JOIN aspnet_Users ON Maintenance_Images.UserIDFK = aspnet_Users.UserId) WHERE (Maintenance_Images.MaintenanceImageID = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="?" QueryStringField="id" />
                </SelectParameters>
            </asp:SqlDataSource>
    
    
    </div>
    <div class = "pCommentB">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2" Height="222px" PageSize="1" Width="340px" 
            style="margin-right: 31px">
        <Columns>
            <asp:ImageField DataAlternateTextField="ImageLink" 
                DataImageUrlField="ImageLink" HeaderText="***Image Comments***">
                <ControlStyle CssClass="imageCommentsImage" />
                <FooterStyle CssClass="imageCommentsImage" />
                <HeaderStyle Height="0px" />
                <ItemStyle BorderStyle="None" CssClass="imageCommentsImage" />
            </asp:ImageField>
        </Columns>
    </asp:GridView>
    
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ImageLink] FROM [Maintenance_Images] WHERE ([MaintenanceImageID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="MaintenanceImageID" QueryStringField="id" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
    
    </div>
    <br />

        <div class = "mComment">
        <div class = "titleMaintenance">
        
        
        
        <div class = "text20" 
        
    style="font-size: medium; font-style: italic; font-weight: bold; height: 21px;">

        User Comments for this Image&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current Tags</div>
        
        
        
        </div>

        <div class = "MaintenanceList">
        <div class = "maintenanceTags">
            <span class="sitemainfooter">To place a tag, you must be a registered user and logged 
            in. Click here to 
        <a href = "Account/Register.aspx">Register</a> or </span> <a href = "Account/Login.aspx">
        Login</a>.<br />
            <br />
            <span class="sitemainfooter"><strong>This image has been tagged the following:</strong></span>
    
    
    
        <asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource5" 
            DataTextField="TagName" DataValueField="TagName" Height="319px" 
            Width="299px" style="text-align: left" Font-Names="Calibri" 
            Font-Size="Medium">
        </asp:ListBox>
            <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                SelectCommand="SELECT Maintenance_Image_Tags.MaintenanceImageIDFK, Tags.TagName FROM (Maintenance_Image_Tags INNER JOIN Tags ON Maintenance_Image_Tags.TagIDFK = Tags.TagID) WHERE (Maintenance_Image_Tags.MaintenanceImageIDFK = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="?" QueryStringField="id" />
                </SelectParameters>
            </asp:SqlDataSource>
            </div>
            <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource3" 
                style="font-size: medium">
                <AlternatingItemTemplate>
                    
                    <br />
                    <strong>Comment:</strong>
                    <asp:Label ID="CommentBodyLabel" runat="server" 
                        Text='<%# Eval("CommentBody") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    
                    <br />
                    <strong>Comment Posted by:</strong>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
<br /></span>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    
                    <br />
                    <strong>Comment:</strong>
                    <asp:TextBox ID="CommentBodyTextBox" runat="server" 
                        Text='<%# Bind("CommentBody") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                        Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                        Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    
                    <strong>Comment Posted by:</strong>
                    <asp:TextBox ID="UserNameTextBox" runat="server" 
                        Text='<%# Bind("UserName") %>' />
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                    <br /><br /></span>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    <span>No data was returned.</span>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <span style=""><br /><strong>Comment:</strong>
                    <asp:TextBox ID="CommentBodyTextBox" runat="server" 
                        Text='<%# Bind("CommentBody") %>' />
                    <br /><strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                        Text='<%# Bind("DateUploaded") %>' />
                    <br /><strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                        Text='<%# Bind("TimeUploaded") %>' />
                    
                    <br /><strong>Comment Posted by:</strong>
                    <asp:TextBox ID="UserNameTextBox" runat="server" 
                        Text='<%# Bind("UserName") %>' />
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                    <br /><br /></span>
                </InsertItemTemplate>
                <ItemTemplate>
                    
                    <br />
                    <strong>Comment:</strong>
                    <asp:Label ID="CommentBodyLabel" runat="server" 
                        Text='<%# Eval("CommentBody") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    
                    <br />
                    <strong>Comment Posted by:</strong>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
<br /></span>
                </ItemTemplate>
                <LayoutTemplate>
                    <div ID="itemPlaceholderContainer" runat="server" 
                        style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                        <span runat="server" id="itemPlaceholder" />
                    </div>
                    <div>
                         <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="5">
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                <asp:NumericPagerField />
                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
            </Fields>
        </asp:DataPager>
                    </div>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    
                    <br />
                    <strong>Comment:</strong>
                    <asp:Label ID="CommentBodyLabel" runat="server" 
                        Text='<%# Eval("CommentBody") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    
                    <br />
                    <strong>Comment Posted by:</strong>
                    <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                    <br />
<br /></span>
                </SelectedItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                SelectCommand="SELECT Maintenance_Image_Comments.CommentBody, Maintenance_Image_Comments.DateUploaded, Maintenance_Image_Comments.TimeUploaded, Maintenance_Image_Comments.ImageID, aspnet_Users.UserName FROM (Maintenance_Image_Comments INNER JOIN aspnet_Users ON Maintenance_Image_Comments.UserID = aspnet_Users.UserId) WHERE (Maintenance_Image_Comments.ImageID = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="?" QueryStringField="id" />
                </SelectParameters>
            </asp:SqlDataSource>
        
        </div>
        </div>
        </div>
  
</asp:Content>
